package com.caxxb.dao.impl;

import com.caxxb.dao.OrderCountDao;
import com.caxxb.entity.OrderCount;
import com.caxxb.util.DBUtil;

import java.util.List;

public class OrderCountDaoImpl implements OrderCountDao {
    @Override
    public List getOrderCount() {
        String sql="SELECT DATE_FORMAT(create_time,'%Y-%m-%d') AS cdays,count(order_id) AS count FROM `order` WHERE date(create_time)> DATE_SUB(CURDATE(),INTERVAL 6 DAY) GROUP BY cdays ORDER BY cdays";
        List list = DBUtil.exQuery(sql, OrderCount.class);
        return list;
    }
}
